# Copyright 2024 The Kumo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

kmcmake_cc_library(
        NAMESPACE nebula
        NAME util_test_common
        SOURCES
        test_common.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        PLINKS
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME align_util_test
        MODULE util
        SOURCES align_util_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME byte_size_test
        MODULE util
        SOURCES byte_size_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)
kmcmake_cc_test(
        NAME byte_stream_split_test
        MODULE util
        SOURCES byte_stream_split_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}

)

kmcmake_cc_test(
        NAME cache_test
        MODULE util
        SOURCES cache_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)


kmcmake_cc_test(
        NAME compression_test
        MODULE util
        SOURCES compression_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME counting_semaphore_test
        MODULE util
        SOURCES counting_semaphore_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME decimal_test
        MODULE util
        SOURCES decimal_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME fixed_width_test
        MODULE util
        SOURCES fixed_width_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)


kmcmake_cc_test(
        NAME formatting_util_test
        MODULE util
        SOURCES formatting_util_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)


kmcmake_cc_test(
        NAME hashing_test
        MODULE util
        SOURCES hashing_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME int_util_test
        MODULE util
        SOURCES int_util_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME iterator_test
        MODULE util
        SOURCES iterator_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME list_util_test
        MODULE util
        SOURCES list_util_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)


kmcmake_cc_test(
        NAME range_test
        MODULE util
        SOURCES range_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME ree_util_test
        MODULE util
        SOURCES ree_util_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)
kmcmake_cc_test(
        NAME reflection_test
        MODULE util
        SOURCES reflection_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME rows_to_batches_test
        MODULE util
        SOURCES rows_to_batches_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME stl_util_test
        MODULE util
        SOURCES stl_util_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME string_test
        MODULE util
        SOURCES string_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME time_test
        MODULE util
        SOURCES time_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME tracing_test
        MODULE util
        SOURCES tracing_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME trie_test
        MODULE util
        SOURCES trie_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME utf8_util_test
        MODULE util
        SOURCES utf8_util_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)

kmcmake_cc_test(
        NAME value_parsing_test
        MODULE util
        SOURCES value_parsing_test.cc
        CXXOPTS
        ${KMCMAKE_CXX_OPTIONS}
        LINKS
        KTest::ktest
        KTest::kmock
        KTest::ktest_main
        nebula::nebula_testing_static
        nebula::nebula_static
        nebula::util_test_common_static
        ${KMCMAKE_DEPS_LINK}
)